package com.meihuayishu.backend.dto;

import jakarta.validation.Valid;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.Builder;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.time.LocalDate;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
@Schema(description = "用户资料更新请求")
public class UserProfileUpdateRequest {
    
    @Size(max = 50, message = "昵称不能超过50字符")
    @Schema(description = "昵称", example = "易学大师")
    private String nickname;
    
    @Schema(description = "头像URL", example = "https://cdn.example.com/avatars/new_avatar.jpg")
    private String avatar;
    
    @Schema(description = "性别", allowableValues = {"MALE", "FEMALE", "OTHER"})
    private String gender;
    
    @Schema(description = "生日", example = "1995-06-15")
    private LocalDate birthday;
    
    @Valid
    @Schema(description = "位置信息")
    private LocationInfo location;
    
    @Valid
    @Schema(description = "偏好设置")
    private PreferencesInfo preferences;
    
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    @Schema(description = "位置信息")
    public static class LocationInfo {
        @Schema(description = "省份", example = "广东省")
        private String province;
        
        @Schema(description = "城市", example = "深圳市")
        private String city;
    }
    
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    @Schema(description = "偏好设置")
    public static class PreferencesInfo {
        @Schema(description = "默认算法", allowableValues = {"TRADITIONAL", "MODERN"})
        private String defaultAlgorithm;
        
        @Schema(description = "AI模型", allowableValues = {"WENXIN", "TONGYI", "CHATGPT"})
        private String aiModel;
        
        @Schema(description = "解读等级", allowableValues = {"BASIC", "PROFESSIONAL", "MASTER"})
        private String interpretationLevel;
        
        @Schema(description = "是否启用通知", example = "true")
        private Boolean notificationEnabled;
        
        @Schema(description = "隐私级别", allowableValues = {"LOW", "NORMAL", "HIGH"})
        private String privacyLevel;
    }
}